home *** CD-ROM | disk | FTP | other *** search
- /********************************************************************************/
- /* */
- /* open.c - open request processing. */
- /* */
- /* Richard W. Mincher. February 19, 1990. */
- /* */
- /* Copyright © 1990 Apple Computer, Inc. All rights reserved. */
- /* */
- /********************************************************************************/
-
- #include "AROSE.h"
- #include "os.h"
- #include "managers.h"
-
- #include "ARDriver.h"
- #include "ARTask.h"
-
- OpenCall()
- {
- G->myTid = msg->mTo;
- G->hisTid = msg->mFrom;
-
- #ifdef DEBUG
- printf("Open received.\n");
- #endif DEBUG
-
- //
- // Allocate transmit buffers.
- //
-
- G->txIn = G->txFirst = G->txOut = GetMem( SIZETX );
- G->txLast = G->txFirst + SIZETX;
- G->txMax = SIZETX;
- G->txCount = G->sTxCount = 0;
- G->txTickle = 0;
- G->txQHead = G->txQTail = 0;
-
- G->txSignal = GetMsg();
- G->txSignal->mTo = G->txSignal->mFrom;
- G->txSignal->mCode = 1000;
-
- //
- // Allocate receive buffers.
- //
-
- G->rxIn = G->rxFirst = G->rxOut = GetMem( SIZERX );
- G->rxLast = G->rxFirst + SIZERX;
- G->rxMax = G->rxCount = SIZERX;
- G->sRxCount = 0;
- G->rxTickle = 0;
- G->rxQHead = G->rxQTail = 0;
-
- G->rxSignal = GetMsg();
- G->rxSignal->mTo = G->rxSignal->mFrom;
- G->rxSignal->mCode = 2000;
-
- // Initialize globals.
-
- G->peChar = 0;
- G->altChar = 0;
- G->flowOff = 0;
- G->asyncErr = 0;
- G->ctlOptions = 0;
- G->xOffFlag = 0;
- G->swhs = 0;
- G->hwhs = 0;
- G->sendXOnff = 0;
- G->CTSFlag = 0;
- G->charMask = 0xFF;
- G->xOnChar = 0x13;
- G->xOffChar = 0x11;
- G->options = 0;
- G->postOptions = 0;
- G->inSwHs = 0;
- G->inHwHs = 0;
- G->moreTx = 0;
- G->readCmd = 0;
- G->writeCmd = 0;
-
- // Set up SCC.
-
- G->baudLow = 0x16;
- G->baudHigh = 0x00;
- // baudLow = 0xFE; baudHigh = 0x11; /* 50 Baud */
- G->lastWR4 = 0x44;
- G->lastWR3 = 0xC1;
- G->lastWR5 = 0xEA;
- G->prevStat = 0;
-
- InitSCC();
- }
-
-